package com.shangxia.monomer.study.designPatterns.behavioralType.state.demoSed;

import lombok.extern.slf4j.Slf4j;

/**
 * @ProjectName: monomer
 * @ClassName: AfternoonWorkState
 * @Time: 2021/8/6
 * @Author: zhouy
 * @Description:
 * @Experience:
 */

@Slf4j
public class AfternoonWorkState implements WorkState {
    @Override
    public void writeProgram(Work work) {
        if (work.getHour() < 18) {
            System.out.println("下午工作很困");
        } else {
            work.setWorkState(new NightWorkState());
            work.writeProgram();
        }
    }
}
